package com.tjian.fafa.user.base.friendRequest;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.tjian.fafa.user.base.commons.GlobalMsgTypes;

public class FriendRequestMsgReceiver extends BroadcastReceiver
{

    @Override
    public void onReceive(Context context, Intent intent)
    {
        Log.d("receiver received", "++++++++++++++++++++++++++++" +
                "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

        int msgType = intent.getIntExtra("fafa.example.hello.msg_type", 0);
        String msgStr = intent.getStringExtra("fafa.example.hello.msg_received");

        switch (msgType)
        {
            case GlobalMsgTypes.msgFriendshipRequest:
                Log.i("qqsssaa", msgStr);
                FriendRequestService.getInstance().processFriendRequest(msgStr);
                break;
            case GlobalMsgTypes.msgFriendshipRequestResponse:
                FriendRequestService.getInstance().processFriendRequestResponse(msgStr);
                break;
            default:
                break;
        }
    }

}
